home *** CD-ROM | disk | FTP | other *** search
/ Software of the Month Club 1998 March / Software of the Month Club 1998 March.iso / pc / dos / lg / astreg / drivers.exe / CANONLBP.PRG < prev    next >
Text File  |  1994-08-13  |  6KB  |  114 lines

  1. FUNCTION canonlbp
  2. PARAMETERS pc_todo,px_param1,px_param2,px_param3,px_param4,px_param5,px_param6,px_param7
  3.  
  4.    PRIVATE lc_params,lc_str,ll_query,ll_toprint
  5.    lc_params = "pc_todo,px_param1,px_param2,px_param3,px_param4,px_param5,px_param6,px_param7"
  6.  
  7.    lc_str     = ""
  8.    ll_query   = .F.
  9.    ll_toprint = .T.
  10.    pc_todo    = UPPER(pc_todo)
  11.    IF pc_todo="QUERY"
  12.       ll_query   = .T.
  13.       ll_toprint = .F.
  14.       IF PCOUNT()=1
  15.          RETURN .T.
  16.       ENDIF
  17.       pc_todo   = UPPER(px_param1)
  18.       px_param1 = px_param2
  19.       px_param2 = px_param3
  20.       px_param3 = px_param4
  21.       px_param4 = px_param5
  22.       px_param5 = px_param6
  23.       px_param6 = px_param7
  24.    ENDIF
  25.  
  26.    DO CASE                                                       
  27.       CASE pc_todo = "VMI"                                       
  28.            lc_str  = CHR(27)+"[2 I"                              
  29.            lc_str  = lc_str + ;                                  
  30.                      CHR(27)+"["+LTRIM(STR(px_param1/2))+"; G"   
  31.                                                                  
  32.       CASE pc_todo = "ORIENTATION"                               
  33.            PRIVATE la_orients,ln_x                               
  34.            DECLARE la_orients[3,2]                               
  35.                                                                  
  36.            la_orients[1,1] = "PORTRAIT"                          
  37.            la_orients[1,2] = "0"                                 
  38.            la_orients[2,1] = "LANDSCAPE"                         
  39.            la_orients[2,2] = "1"                                 
  40.                                                                  
  41.            ln_x = 1                                              
  42.            px_param1 = UPPER(px_param1)                          
  43.            DO WHILE TYPE("la_orients[ln_x,1]")='C'               
  44.               IF la_orients[ln_x,1] = px_param1                  
  45.                  EXIT                                            
  46.               ENDIF                                              
  47.               ln_x = ln_x + 1                                    
  48.            ENDDO                                                 
  49.                                                                  
  50.            IF TYPE("la_orients[ln_x,1]") = 'C'                   
  51.               lc_str = CHR(27)+"["+la_orients[ln_x,2]+"p"        
  52.            ENDIF                                                 
  53.                                                                  
  54.       CASE pc_todo = "PFEED"                                     
  55.            lc_str = CHR(27)+"["+;                                
  56.                     IIF(UPPER(px_param1)="MANUAL","1","0")+"q"   
  57.                                                                  
  58.       CASE pc_todo = "PSIZE"                                     
  59.            PRIVATE la_psizes,ln_x                                
  60.            DECLARE la_psizes[5,2]                                
  61.                                                                  
  62.            la_psizes[1,1] = "A4"                                 
  63.            la_psizes[1,2] = "14"                                 
  64.            la_psizes[2,1] = "B5"                                 
  65.            la_psizes[2,2] = "26"                                 
  66.            la_psizes[3,1] = "LETTER"                             
  67.            la_psizes[3,2] = "30"                                 
  68.            la_psizes[4,1] = "LEGAL"                              
  69.            la_psizes[4,2] = "32"                                 
  70.                                                                  
  71.            ln_x = 1                                              
  72.            px_param1 = UPPER(px_param1)                          
  73.            DO WHILE TYPE("la_psizes[ln_x,1]")='C'                
  74.               IF la_psizes[ln_x,1] = px_param1                   
  75.                  EXIT                                            
  76.               ENDIF                                              
  77.               ln_x = ln_x + 1                                    
  78.            ENDDO                                                 
  79.                                                                  
  80.            IF TYPE("la_psizes[ln_x,1]") = 'C'                    
  81.               lc_str = CHR(27)+"["+la_psizes[ln_x,2]+"p"         
  82.            ENDIF                                                 
  83.                                                                  
  84.       CASE pc_todo = "TMARGIN"                                   
  85.            PRIVATE ln_tmargin                                    
  86.                                                                  
  87.            ln_tmargin = (px_param1/2 - ((123/300) * 720))        
  88.                                                                  
  89.            IF ln_tmargin >= 0                                    
  90.               lc_str = CHR(27)+"[2 I"+CHR(27)+"[11h"             
  91.               lc_str = lc_str+CHR(27)+"["+;                      
  92.                        LTRIM(STR(ln_tmargin))+"d"                
  93.               lc_str = lc_str+CHR(27)+"[2t"                      
  94.            ENDIF                                                 
  95.     ENDCASE                                                      
  96.                                                                  
  97.  
  98.     IF ll_toprint
  99.        ??? lc_str
  100.     ELSE
  101.       IF ll_query
  102.          px_param7 = px_param6
  103.          px_param6 = px_param5
  104.          px_param5 = px_param4
  105.          px_param4 = px_param3
  106.          px_param3 = px_param2
  107.          px_param2 = px_param1
  108.       ENDIF
  109.     ENDIF
  110.  
  111. RETURN .NOT. ISBLANK(lc_str)
  112.  
  113.                                                                  
  114.